package com.bee2c.platform.web.test;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.alibaba.fastjson.JSONObject;
import com.bee2c.platform.web.test.client.BeeOsgiClient;
import com.bee2c.pub.util.bean.ProcessResult;

@RestController
public class BeeSogiController {

	@Autowired
	private BeeOsgiClient osgiClient;

	@RequestMapping(value = "/getBeeOsgiClientConfig")
	public ProcessResult getBeeOsgiClientConfig() {
		String bcid = "com.zte.zas.common.business.BusinessCenter4ZasSub.sub__getTenantConfigValue";
		Integer groupId = 0;
		JSONObject paraJson = new JSONObject();
		paraJson.put("tenantId", 1L);
		paraJson.put("configCode", "ETC_TRAIN_APPROVE");
		return osgiClient.client(bcid, groupId, paraJson);
	}
	
	@RequestMapping(value = "/getBeeOsgiPlatConfig")
	public ProcessResult getBeeOsgiPlatConfig() {
		String bcid = "com.zte.zas.common.business.BusinessCenter4ZasSub.sub__getTenantConfigValue";
		JSONObject paraJson = new JSONObject();
		paraJson.put("tenantId", 1L);
		paraJson.put("configCode", "DOMAIRSP_TICKETCHANGE_YXZB_TIP");
		return osgiClient.platform(bcid, paraJson);
	}
	
	@Value(value="${beeosgi.beesphessionurl}")
	private String beesphessionurl;
	
	@RequestMapping(value = "/getCfgValue")
	public String getCfgValue() {
		return beesphessionurl;
	}
}
